home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-03 / vbengine.zip / DEMO2.FRM (.txt) < prev    next >
Visual Basic Form  |  1993-04-04  |  9KB  |  238 lines

  1. Form1
  2. #VBENGINE SAMPLE APPLICATION - DEMO2
  3. Form1,
  4. Label1
  5.     Customer:
  6. Text1
  7. Label5
  8. Address:
  9. Text2
  10. Label6
  11. City:
  12. Text3
  13. Label7
  14. State:
  15. Text4
  16. Label8
  17. Text5
  18. Label9
  19. Phone:
  20. Text6
  21.     TopButton
  22. BottomButton
  23. Bottom
  24. PreviousButton
  25. Previous
  26. NextButton
  27. UpdateButton
  28. Update
  29. InsertButton
  30. Insert
  31. DeleteButton
  32. Delete
  33. QuitButton
  34. ClearButton
  35. Clear
  36. Command1_Click
  37. result
  38. OpenEngine
  39. CloseEngine
  40.     OpenTable
  41. Data1
  42. DBase
  43. TableJ
  44.     TableNamed
  45. IndexID
  46. SaveChgs
  47. CloseTable9
  48.     GetRecord
  49. Field,
  50.     FieldName
  51. SetField
  52. GetFieldTypeE
  53.     FieldType
  54. GetField
  55. FieldValue
  56. Text1v
  57. Text2
  58. Text3
  59. Text4
  60. NextRecord
  61. PreviousRecord
  62. PutField
  63. LastRecord
  64. UpdateRecordK
  65. SearchField
  66. Record
  67. SearchMode
  68. FIRSTRECORDh
  69.     KeySearchH
  70.     SearchKey'
  71. RecordLock;
  72. RecordUnlockLock
  73. RecordUnlock
  74. RefreshTable
  75.     TableLock
  76.     LockTable
  77. FULLLOCK
  78. UnlockTable
  79. FALSE
  80. FlushBuffers]
  81. MyName
  82. GetUserName
  83. Form_Click
  84.     Form_Load?
  85. Form_UnloadZ
  86. Cancel
  87. GetIT.
  88. FillForm
  89. Command4_Click/
  90. Command3_ClickA
  91. Command9_ClickS
  92. Command2_Clicke
  93. Command5_Clickw
  94. Command6_Click
  95. Command7_Click
  96. InsertRecord
  97. Command8_Click
  98. DeleteRecordj
  99. Text5
  100. Text6
  101. Text7
  102. Text8
  103. UpdateM
  104. Text9
  105. Text10
  106. Insert
  107. Text4_Change
  108. SHARE
  109. MASTERINDEX
  110. Form_DblClick
  111. EmptyTable
  112.     MNU_Click
  113. EncryptTable
  114. DecryptTable
  115. Password
  116. Data2\
  117. CreateTable
  118. Label4_Click
  119. NFlds
  120. FldTypes
  121. FldNames:
  122. Testy
  123. NewTable
  124. NFields
  125. FieldNames
  126. FieldTypesm
  127. AddKey
  128. PRIMARY
  129.     DeleteKey2
  130. GotoRecord
  131. RecordNumber
  132. GetRecordNumber
  133. IsFieldBlank
  134. BlankPtr
  135. PutBlank
  136.     DataTablev
  137. Customer
  138. SaveEveryChange
  139. TopButton_Click
  140. BottomButton_Click
  141. PreviousButton_Click
  142. NextButton_Click
  143. DeleteButton_Click
  144. UpdateButton_Click
  145. InsertButton_Click
  146. QuitButton_Clickl
  147. Text1_Change
  148. status
  149. ClearButton_Click
  150. Text1_LostFocus
  151. KeSearch
  152. SEARCHFIRST
  153. NewNamer
  154. Create a database variable using the DataTable structure for database operations
  155. Form_Load
  156. Initialize VBENGINE so that database capabilities are enabled.
  157. Call OpenEngine() with a string representing the user's name..
  158. and using SHARE representing file sharing mode..
  159. Visual Basic
  160. Now put the data table file name (C:\CUSTOMER.DB) in the data structureA
  161. C:\CUSTOMER"
  162. We will use the tables master index:
  163. We will buffer data changese
  164. Now open the table
  165. Now read in the data from the first record and place it in our form.
  166. Form_Unload
  167. FillForm
  168. Get the record from the table 
  169. Now lets get the customers name and put it in our form.f
  170. Specify what field we are interested in.
  171. Read in the value.
  172. Place it in the form.
  173. Now do the same thing for every field in our form ....
  174. Address"
  175. State"
  176. Phone"
  177. Update
  178. Here we do the same process found in the Insert subroutine..
  179. See that routine for reference..
  180. Address"
  181. State"
  182. Phone"
  183. Here we UPDATE the current record in the table..
  184. Insert
  185. Here we are transfering information from our form to the table..
  186. We must first associate a form value with specific fields in our table..
  187. We will make such associations by first specifying the data table field of
  188. interest. Then take the data from the corresponding form field and thenn
  189. put the field into the current record.
  190. Specify the field in the data table.
  191. Place corresponding form data into the database structures FieldValue member.
  192. Now put the field structure into the current record.
  193. Now repeat the process for all form fields..
  194. Address"
  195. State"
  196. Phone"
  197. Now INSERT the current record into the table..
  198. MNU_Click
  199. TopButton_Click
  200. Move to the first record in the table.
  201. Now fill in the form
  202. BottomButton_Click
  203. Move to the last record in the table..
  204. Now fill in the form
  205. PreviousButton_Click
  206. Move to the previous record in the table.L
  207. Now fill in the form.r
  208. NextButton_Click
  209. Move to the next record in the table.b
  210. Now fill in the form.r
  211. DeleteButton_Click
  212. Delete the current record from the data table.
  213. Now fill in the form.c
  214. UpdateButton_Click
  215. InsertButton_Click
  216. QuitButton_Click
  217. Close the data table.c
  218. Shut down the VBENGINE environment.d
  219. Now quit this application.
  220. ClearButton_Click
  221. Text1_LostFocus
  222. For error handling
  223. Temp variable for new customer namew
  224. Primary key field is Namew
  225. We will search for user supplied customer name
  226. We will search from 1st record to 1st matche
  227. Search on the 1st field of primary index
  228. This table only has 1 key field anyway.p
  229. Place search criteria into the database engine
  230. Start to search on the Primary index
  231. If search failed
  232. Put new customer name in temporary variablen
  233. Clear the form u
  234. Place new name back on the forma
  235. Return to user input
  236. If search was successfullf
  237. Place the customer's info on the formo
  238.